<template>
    <div>
        <h1 style="float: left;font-size: 30px;">银行卡绑定</h1>
        <br><br><br><br><br><br>
        <div style="width: 500px;">
            <el-form ref="form" :model="bankcard" label-width="80px">
                <el-form-item label="银行卡号">
                    <el-input v-model="bankcard.cardNo"></el-input>
                </el-form-item>
                <el-form-item label="预留手机号">
                    <el-input v-model="bankcard.phone"></el-input>
                </el-form-item>
                <el-form-item label="持卡人">
                    <el-input v-model="bankcard.cardholder"></el-input>
                </el-form-item>
                <el-form-item label="身份证号码">
                    <el-input v-model="bankcard.identity_id"></el-input>
                </el-form-item>

                <el-form-item>
                    <el-button type="primary" @click="bankCardVerify">绑定</el-button>
                    <el-button>取消</el-button>
                </el-form-item>
            </el-form>
        </div>
    </div>
</template>

<script>
    export default {
        name: "bindBankCard",
        data() {
            return {
                bankcard: {
                    cardNo: '',
                    phone: '',
                    cardholder: '',
                    identity_id: '',
                },
                userId:this.$route.query.userId
            }
        },
        // sdfds
        methods: {
            onSubmit() {
                console.log('submit!');
            },
            // 验证银行卡
            bankCardVerify(){
                this.$http.post('api/crud/bankcard/verifyBankCard?userId='+this.userId,this.bankcard).then(res=>{
                    if(res.data.data.status=="01"){
                        alert('认证成功')
                        this.$router.push('/creditLoan')
                    }else{
                        alert(res.data.data.msg)
                    }
                })
            }
        }
    }
</script>

<style scoped>

</style>